package com.ebupt.migu.music;

import com.baomidou.mybatisplus.autoconfigure.ConfigurationCustomizer;
import com.baomidou.mybatisplus.extension.MybatisMapWrapperFactory;
import org.springframework.boot.Banner;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 * @author liuzz
 * @date 2019-8-21
 */
@SpringBootApplication
@EnableAsync
@EnableCaching
public class UserGroupLabelApplication {
    public static void main(String[] args) {
        // web
        // SpringApplication.run(FineOperationApplication.class, args);

        // 非web
        new SpringApplicationBuilder(UserGroupLabelApplication.class)
                .web(WebApplicationType.NONE) // .REACTIVE, .SERVLET
                .bannerMode(Banner.Mode.OFF)
                .run(args);
    }

    /**
     * mp 3.2.0以上版本， map驼峰转换
     */
    @Bean
    public ConfigurationCustomizer configurationCustomizer() {
        return i -> i.setObjectWrapperFactory(new MybatisMapWrapperFactory());
    }
}
